package com.zwy.handler;

import lombok.Getter;
import lombok.extern.slf4j.Slf4j;

/**
 * @author zwy
 * @version 1.0
 * @description: GlobalUncaughtExceptionHandler
 * @date 2025/9/18 20:04
 */
@Slf4j
public class GlobalUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler {

    @Getter
    private static final GlobalUncaughtExceptionHandler instance = new GlobalUncaughtExceptionHandler();

    private GlobalUncaughtExceptionHandler() {
    }

    @Override
    public void uncaughtException(Thread t, Throwable e) {
        log.error("Exception in thread {} ", t.getName(), e);
    }

}